{
  "name"    : "Apiviewer (export) config",

  "jobs" :
  {
    "common" :
    {
      "let" :
      {
        "APIVIEWER_ROOT" : ".",
        "APIVIEWER"      : "apiviewer",
        "APPLICATION"    : "apiviewer",
        "QOOXDOO_PATH" : "../..",
        "API_INCLUDE"    : ["*"],
        "API_EXCLUDE"    : [],
        "BUILD_PATH"     : "${APIVIEWER_ROOT}/build",
        "CACHE"          : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache"
      },

      "library" :
      [
        {
          "manifest" : "${QOOXDOO_PATH}/framework/Manifest.json"
        },

        {
          "manifest" : "${APIVIEWER_ROOT}/Manifest.json"
        },

        {
          "manifest" : "${QOOXDOO_PATH}/component/library/versionlabel/Manifest.json"
        }
      ],

      "environment" :
      {
        "qx.application"  : "${APIVIEWER}.Application",
        "qx.theme"        : "${APIVIEWER}.Theme",
        "qx.version"      : "${QOOXDOO_VERSION}",
        "qx.revision"     : "${QOOXDOO_REVISION}",
        "qx.nativeScrollBars" : true
      },

      "cache" :
      {
        "compile"      : "${CACHE}",
        "downloads"    : "${CACHE}/downloads",
        "invalidate-on-tool-change" : true
      }
    },


    "source-script" :
    {
      "extend" : ["common"],
      "include" : ["${APIVIEWER}.*"],

      "compile-options" :
      {
        "paths" :
        {
          "file" : "./source/script/${APIVIEWER}.js",
          "app-root" : "source"
        },

        "code" : { "except" : [ "*" ] }
      },

      "compile" : { "type" : "source" }
    },


    "source" :
    {
      "run" :
      [
        "source-script",
        "source-data"
      ]
    },


    "build-script" :
    {
      "extend" : ["common"],
      "include" : ["${APIVIEWER}.*"],

      "environment" :
      {
        "qx.aspects" : false,
        "qx.debug" : false
      },

      "compile-options" :
      {
        "paths" :
        {
          "file" : "${BUILD_PATH}/script/${APIVIEWER}.js",
          "app-root" : "${BUILD_PATH}"
        },
        "code" :
        {
          "format"   : true,
          "optimize" : ["strings", "basecalls", "variables", "privates", "variants", "whitespace"],
          "except"   : []
        }
      },

      "compile" : { "type" : "build" }
    },


    "build-files" :
    {
      "extend" : ["common"],
      "include" : ["${APIVIEWER}.*"],

      "copy-files" :
      {
        "files" :
        [
          "index.html"
        ],

        "target" : "${BUILD_PATH}",
        "source" : "${APIVIEWER_ROOT}/source"
      }
    },


    "build-resources":
    {
      "extend" : ["common"],
      "include" : ["${APIVIEWER}.*"],

      "environment" :
      {
        "qx.aspects" : false,
        "qx.debug" : false
      },

      "copy-resources" :
      {
        "target" : "${BUILD_PATH}"
      }
    },


    "build" :
    {
      "run" :
      [
        "build-viewer",
        "build-data"
      ]
    },


    "build-viewer" :
    {
      "run" :
      [
        "build-resources",
        "build-script",
        "build-files"
      ]
    },


    "source-data" :
    {
      "extend" : ["common"],

      "include" : "${API_INCLUDE}",
      "exclude" : "${API_EXCLUDE}",

      "api" :
      {
        "path" : "source/script"
      }
    },


    "build-data" :
    {
      "config-warnings" :
      {
        "exclude" : "${API_EXCLUDE}",
        "environment" : [ "non-literal-keys" ]
      },
      "extend" : ["common"],

      "include" : "${API_INCLUDE}",
      "exclude" : "${API_EXCLUDE}",

      "api" :
      {
        "path" : "${BUILD_PATH}/script"
      }
    }
  }
}
